<?php
session_start();
if (isset($_SESSION['openid'])){
    include '../c/config.php';
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
    $openid=$_SESSION['openid'];

    $query=$mysqli->query("SELECT name,phone,dizhi,yuce,hasright from `uinfo` where openid='".$openid."' limit 0,1 ");
    if($query->num_rows>0){
        $getU=$query->fetch_assoc();
        if (1 == $getU['hasright']){
            $right='true';
        }else{
            $right='false';
        }
        unset($getU['hasright']);
        echo json_encode(array('s'=>'ok','u'=>$getU,'right'=>$right,'fp'=>$_SESSION['openid'].'.jpg'));
    }else{
        echo json_encode(array('s'=>'not'));
    }
 
    $mysqli->close();
   
}
